Next | Prev | Up | Top | Contents | Index

Time Data Structures

The include files time.h and sys/time.h define several data types and data structures related to time with confusing relationships between them. Some features of these structures are summarized in Table 5-3.

Time Data Structure Usage
Data TypeDeclared InContainsSome Functions Using this Type
time_t time.h long int with time in seconds since 00:00:00 UTC, January 1, 1970time(2), ctime(3C), cftime(3C), difftime(3C)
timeval sys/time.h time_t of seconds, long of microseondsadjtime(2), getitimer(2), getrusage(3C), gettimeofday(3C), select(2), utimes(3B), utmpx(4)
itimerval sys/time.h two timeval fields for first interval and repeat intervalgetitimer(2) and setitimer(2)
timespec_t time.h time_t of seconds, long of nanosecondsclock_gettime(2), nanosleep(2), aio_suspend(3), sigtimedwait(3)
itimerspec time.h two timespec fields for first interval and repeat interval(none at this time)
tm time.h int fields for seconds, minutes, hours, day, month, year, etc.localtime(2), gmtime(2), strftime(3C)


Next | Prev | Up | Top | Contents | Index